package com.lagou.test;

import com.lagou.domin.Article;
import com.lagou.service.ArticleService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

/**
 * @Author jiang.weiyu
 * @Date 2021/02/09 14:04
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class Mybatis_test {

    @Autowired
    private ArticleService articleService;

    @Test
    public void test(){
        List<Article> all = articleService.findAllComment();

        for (Article article : all) {
            System.out.println(article);
        }
    }

    @Test
    public void test2(){
        List<Article> allComment = articleService.findAllComment();

        for (Article article : allComment) {
            System.out.println(article);
        }
    }
}
